package com.zhuge_new.Base;

/**
 * Created by Administrator on 2018/10/25.
 */

public class BasePresenter <V extends BaseView>{

    /**
     *    绑定的view
     */

    private V view;

    /**
     *    绑定view
     */

    public void attachView(V view){
        this.view=view;
    }

    /**
     *  断开view连接
     */

    public void detachView(){
        this.view=null;
    }

    /**
     * 是否与View建立连接
     * 每次调用业务请求的时候都要出先调用方法检查是否与View建立连接
     */
    public boolean isViewAttached() {
        return view != null;
    }

    /**
     * 获取连接的view
     */
    public V getView() {
        return view;
    }
}

